package com.wm.exam.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wm.exam.dao.CategoryVoMapper;
import com.wm.exam.service.CategoryVoService;
import com.wm.exam.vo.CategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryVoServiceImpl implements CategoryVoService {
    @Autowired
    private CategoryVoMapper categoryVoMapper;

    /**
     * 查询所有
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Override
    public PageInfo<CategoryVo> getAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<CategoryVo> categoryVoList = categoryVoMapper.getAll();
        PageInfo<CategoryVo> pageInfo = new PageInfo(categoryVoList);
        return pageInfo;
    }
}
